<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Article Views : Ionize User Guide</title>

<style type='text/css' media='all'>@import url('../userguide.css');</style>
<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />

<script type="text/javascript" src="../nav/nav.js"></script>
<script type="text/javascript" src="../nav/prototype.lite.js"></script>
<script type="text/javascript" src="../nav/moo.fx.js"></script>
<script type="text/javascript" src="../nav/user_guide_menu.js"></script>

<meta http-equiv='expires' content='-1' />
<meta http-equiv= 'pragma' content='no-cache' />
<meta name='robots' content='all' />
<meta name='author' content='Ionize Dev Team' />
<meta name='description' content='Ionize User Guide' />

</head>
<body>

<!-- START NAVIGATION -->
<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
<div id="nav2" onclick="myHeight.toggle();"><a name="top"></a><a href="javascript:void(0);"><img src="../images/nav_toggle_darker.jpg" width="154" height="43" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
<td><h1>Ionize User Guide Version 0.9.7</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
</div>
<!-- END NAVIGATION -->


<!-- START BREADCRUMB -->
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
<td id="breadcrumb">
<a href="http://www.ionizecms.com/">Ionize Home</a> &nbsp;&#8250;&nbsp;
<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
Article Views
</td>
<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="ionizecms.com/user-guide" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
</tr>
</table>
<!-- END BREADCRUMB -->

<br clear="all" />


<!-- START CONTENT -->
<div id="content">

<h1>Article Views</h1>

<p>One article is linked to one or more pages.</p>
<p>Articles are displayed in the context of a page.</p>


<h2>Creating an article view and link it to an article</h2>

<ol>
	<li>Use a text editor and save the file with the name you wish in the <dfn>/themes/</dfn><var>your_theme/</var><dfn>views/</dfn><kbd>your_article_view.php</kbd>,</li>
	<li>Activate the view as an <strong>"article"</strong> view : see <a href="./views.html">Activate pages and articles views</a>,</li>
	<li>Edit the page containing the article to link to this view,</li>
	<li>In the article list, select the view in the view dropdown</li>
</ol>


<h2>Iterating through articles in the view</h2>

<p>They are 2 ways of iterating through articles :</p>
<ol>
	<li>Using the <dfn>&lt;ion:article /></dfn> tag and display each article with its linked view,</li>
	<li>Looping into article's data directly in the page view.</li>
</ol>

<h3>Case 1 : Using of the article tag</h3>

<p>Let's say we have 2 articles.</p>
<p>Each article is linked to a view, the first one to the view <var>my_first_article.php</var> and the second one to the view <var>my_second_article.php</var>.</p>
<p>When iterating through articles, the first article will be displayed with the view <var>my_first_article.php</var>.</p>
<p><var>my_first_article.php</var> will contains articles tags such as <strong>title, content</strong>, etc.</p>

<pre>
<dfn>&lt;!-- Display, for each article, the view linked to the article through Ionize --></dfn>
&lt;ion:articles >

   &lt;ion:article />

&lt;ion:/ion:articles >
</pre>

<h3>Case 2 : Looping into articles data</h3>

<p>In this case, the linked view of the article isn't used.</p>

<pre>
<dfn>&lt;!-- Displays directly data from articles --></dfn>
&lt;ion:articles >

   &lt;ion:title />

   &lt;ion:content />
 
&lt;ion:/ion:articles >
</pre>




</div>
<!-- END CONTENT -->


<div id="footer">
<p>
Previous Topic:&nbsp;&nbsp;<a href="../general/page_views.html">Page Views</a>
&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
Next Topic:&nbsp;&nbsp;<a href="../general/display_language_navigation.html"></a>
</p>
<p><a href="http://www.ionizecms.com/">Ionize website</a></p>
</div>

</body>
</html>